package com.campus.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.campus.mapper.FacultyMapper;
import com.campus.pojo.po.Faculty;
import com.campus.pojo.vo.FacultyVO;
import com.campus.service.FacultyService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
@RequiredArgsConstructor
public class FacultyServiceImpl implements FacultyService {

    private final FacultyMapper facultyMapper;

    @Override
    public List<FacultyVO> getFaculty() {
        // 获取院系列表
        List<Faculty> faculty = facultyMapper.getFaculty();
        //创建返回视图对象
        return BeanUtil.copyToList(faculty, FacultyVO.class);
    }
}
